#coding=utf-8

import os

test = 0

def renamer():
    path = 'F:\\0MTV\\Will and Grace'
    os.chdir(path)
    for file_name in os.listdir(path):
        new_filename = file_name.lstrip('R')
        if test:
            print new_filename
        else:
            os.rename(file_name,new_filename)

def extractor():
    path = 'F:\\0MTV\\MP3'
    os.chdir(path)
    for f in os.walk(path):
        if len(f[-1])>0:
            for file_name in f[-1]:
                os.rename(f[0]+'\\'+file_name,path+'\\'+file_name)
        
if __name__=='__main__':
    #extractor()
